var RecaptchaOptions = { theme : 'white' };

function al(){
	alert("s");
}
	
function form_type_display() {
	disable_all_forms();
	//alert("s");
	if (document.getElementById('type').value == 'student') {
		var className = 'student_form';
	} else if(document.getElementById('type').value == 'faculty'){
		var className = 'faculty_form';
	} else if(document.getElementById('type').value == 'encoder'){
		var className = 'encoder_form';
	}
	
	/*get elements by class*/
	/*http://stackoverflow.com/questions/3808808/how-to-get-element-by-class-in-javascript*/
	var elems = document.getElementsByTagName('*'), i;
	for (i in elems) {
		if((' ' + elems[i].className + ' ').indexOf(' ' + className + ' ')
				> -1) {
			elems[i].style.display = 'table-row';
		}
	}
	/*Add a required attribute to the form*/
	if(className == 'student_form'){
		document.getElementById('stud_num').setAttribute('required');
	}else if(className == 'faculty_form'){
		document.getElementById('emp_num').setAttribute('required');
	}
	
	
}

function disable_all_forms(){
	var elems = document.getElementsByTagName('tr'), i;
	var form_names = new Array();
	form_names[0] = 'student_form';
	form_names[1] = 'faculty_form';
	form_names[2] = 'encoder_form';
	for (h in form_names){
		for (i in elems) {
			if((' ' + elems[i].className + ' ').indexOf(' ' + form_names[h] + ' ')
					> -1) {
				elems[i].style.display = 'none';
				document.getElementById('stud_num').removeAttribute('required');
				document.getElementById('emp_num').removeAttribute('required');
			}
		}
	}
}

